import 'package:flutter/material.dart';
import 'package:flutter_app/components/layout.dart';
class AuthHomePage extends StatefulWidget {
  @override
  _AuthHomePageState createState() => _AuthHomePageState();
}

Widget AuthItem(String title,String subTitle,String limit, Widget right) {
  return Container(
    margin: EdgeInsets.fromLTRB(0, 20, 0, 0),
    padding: EdgeInsets.symmetric(horizontal: 15,vertical: 20),
    decoration: BoxDecoration(
      color: Colors.blueAccent.withOpacity(0.05)
    ),
    child: Row(
      mainAxisAlignment: MainAxisAlignment.spaceBetween,
      children: [
        Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: [
            Text(title,style: TextStyle(color:Colors.black,fontWeight: FontWeight.w500),),
            SizedBox(
              height: 10,
            ),
            Row(
              children: [
                Text(subTitle,style: TextStyle(color: Colors.grey.withOpacity(0.7),fontSize: 13),),
                SizedBox(
                  width: 8,
                ),
                Text(limit,style: TextStyle(fontFamily: 'dinpro',fontWeight: FontWeight.bold),)
              ],
            ),
          ],
        ),
        right
      ],
    ),
  );
}

class _AuthHomePageState extends State<AuthHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar:DarkHeadBar('身份认证'),
      body: Container(
        padding: EdgeInsets.symmetric(horizontal: 15.0, vertical: 20.0),
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: [
            Row(
              crossAxisAlignment: CrossAxisAlignment.end,
              children: [
                Text('momoko',
                    style: TextStyle(fontFamily: 'dinpro', fontSize: 20)),
                SizedBox(
                  width: 5,
                ),
                Text(
                  '239887********11',
                  style: TextStyle(fontFamily: 'dinpro', color: Colors.grey),
                ),
              ],
            ),
            SizedBox(
              height: 5,
            ),
            Text('完成身份认证，获得更多服务权限。',style: TextStyle(color: Colors.black.withOpacity(0.5)),),
            Wrap(
              children: [
                AuthItem(
                  'Lv.1 基础认证',
                  '认证后可提币，24小时限额',
                  '\$1,000',
                  Image.asset(
                    "assets/images/common_ic_motion_step_done.png",
                    width: 30,
                  ),
                ),
                AuthItem(
                    'Lv.2 高级认证',
                    '增加提币额度，24小时限额',
                    '\$1,000',
                    Container(
                      width: 60,
                      height: 30,
                      child: FlatButton(
                        padding: EdgeInsets.zero,
                        onPressed: (){},
                        color: Colors.white,
                        child: Text('去认证',style: TextStyle(color: Colors.blueAccent,fontSize: 13),),
                      ),
                    )
                ),
                AuthItem(
                    'Lv.3 视频认证',
                    '认证后可提币，24小时限额',
                    '\$1,000',
                    Text('未认证',style: TextStyle(color: Colors.grey),)
                ),

              ],
            )
          ],
        ),
      ),
    );
  }
}
